package com.dsp.soundscape.server.rpc;

import com.dsp.soundscape.client.services.ZipService;
import com.dsp.soundscape.model.AlbumInfo;
import com.dsp.soundscape.model.ZipInfo;
import com.dsp.util.ZipUtil;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class ZipServiceImpl extends RemoteServiceServlet implements ZipService {
	private static final long serialVersionUID = 3907929244195484468L;

	@Override
	public ZipInfo getProgress(String id) {
		return ZipUtil.getProgress(id);
	}

	@Override
	public String getM3U(AlbumInfo album, String url) {
		return ZipUtil.createM3U(album, url.replace(getThreadLocalRequest().getContextPath(), ""));
	}

	@Override
	public ZipInfo requestZipFile(AlbumInfo album) {
		return ZipUtil.createZipFile(album);
	}

}
